/**
 * @file framebuffer.cpp
 * @author ThomasKingFree
 * @version 0.1
 * @date 2021-03-16
 *
 * @copyright Copyright (c) 2021
 *
 */

#include "core/framebuffer.h"

#include "utils/gui_dfx.h"

namespace YueGUI {
FrameBuffer::FrameBuffer()
{
}

FrameBuffer::~FrameBuffer()
{
    framebuffer_ = nullptr;
}

void FrameBuffer::SetFramebuffer(void *framebuffer)
{
    Dfx::Assert(framebuffer != nullptr);
    framebuffer_ = framebuffer;
}


void *FrameBuffer::GetFramebuffer() const
{
    return framebuffer_;
}

void FrameBuffer::SetFrambufferFormat(ColorFormat format)
{
    format_ = format;
}

ColorFormat FrameBuffer::GetFramebufferFormat() const
{
    return format_;
}

void FrameBuffer::SetFramebufferWidth(int16_t width)
{
    Dfx::Assert(width > 0);
    width_ = width;
}

int16_t FrameBuffer::GetFramebufferWidth() const
{
    return width_;
}
} // namespace YueGUI